from django.db import models


class School(models.Model):
    css_image = models.ImageField(upload_to='school/', max_length=200, verbose_name='学校校徽')
    css_name = models.CharField(max_length=20, verbose_name='学校名称')
    css_phone = models.CharField(max_length=11, verbose_name='联系电话', unique=True)
    css_password = models.CharField(max_length=20, verbose_name='登录密码')
    css_address = models.CharField(max_length=200, verbose_name='学校地址')
    css_desc = models.CharField(max_length=200, verbose_name='学校简介')
    css_detail = models.TextField(verbose_name='学校详情')
    css_role = models.CharField(default='school', max_length=20)
    css_time = models.DateTimeField(auto_now_add=True, verbose_name='添加时间')

    def __str__(self):
        return self.css_name

    class Meta:
        verbose_name = '学校信息'
        verbose_name_plural = verbose_name
        db_table = 'school'
